<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="button" value="播放" onclick="OnClick()">
</body>
<script>
    let elem=document.querySelector('input')
    //检测当前的状态进行切换
    function OnClick()
    {
        if(elem.value=='播放') elem.value='暂停'
        else elem.value='播放'
    }
</script>
</html>